package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.PendingTasksDto;
import com.zzyl.entity.PendingTasks;
import com.zzyl.service.ActFlowCommService;
import com.zzyl.utils.UserThreadLocal;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author sjqn
 * @date 2023/11/9
 */
@RestController
@RequestMapping("/pending_tasks")
@Api(tags = "我的待办")
public class PendingTasksController {

    @Autowired
    private ActFlowCommService actFlowCommService;



    @PostMapping("/selectByPage")
    public ResponseResult selectByPage(@RequestBody PendingTasksDto pendingTasksDto){
        //到哪里查询  actFlowCommservice

        Long mgtUserId = UserThreadLocal.getMgtUserId();

        //代理人
        pendingTasksDto.setAssigneeId(mgtUserId);

        PageResponse<PendingTasks>  pageResponse =  actFlowCommService.getMyTaskList(pendingTasksDto);
        return ResponseResult.success(pageResponse);
    }
}
